package com.cyj.dream.admin.service.system.impl;

import com.cyj.dream.admin.model.system.SysDepartment;
import com.cyj.dream.admin.persistence.manager.systems.SysDepartmentManager;
import com.cyj.dream.admin.service.system.SysDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 系统部门信息服务实现类
 * @BelongsProject: dream-DreamChardonnay
 * @BelongsPackage: com.dream.DreamChardonnay.service.impl
 * @Author: ChenYongJia
 * @CreateTime: 2021-05-10 12:04
 * @Email: chen87647213@163.com
 * @Version: 1.0
 */
@Service
public class SysDepartmentServiceImpl implements SysDepartmentService {

    @Autowired
    private SysDepartmentManager sysDepartmentManager;

    /**
     * 根据主键id查询系统部门信息
     *
     * @param sysDepartmentId 部门id
     * @return com.dream.DreamChardonnay.model.system.SysDepartment
     * @date 2021/5/31 14:09
     * @author ChenYongJia
     * @version 1.0
     */
    @Override
    public SysDepartment selectSysDepartmentBySysDepartmentId(Long sysDepartmentId){
        return sysDepartmentManager.selectSysDepartmentBySysDepartmentId(sysDepartmentId);
    }

    /**
     * 根据部门对象信息查询部门菜单树
     *
     * @param sysDepartment 部门对象
     * @return java.util.List<com.dream.DreamChardonnay.model.system.SysDepartment>
     * @date 2021-6-10 15:11:33
     * @author ChenYongJia
     * @version 1.0
     */
    @Override
    public List<SysDepartment> selectSysDepartmentTree(SysDepartment sysDepartment) {
        return sysDepartmentManager.selectSysDepartmentTree(sysDepartment);
    }

    /**
     * 根据部门id查询部门信息
     *
     * @param sysDepartmentParentId 部门id
     * @return java.util.List<com.dream.DreamChardonnay.model.system.SysDepartment>
     * @date 2021-5-31 14:12:08
     * @author ChenYongJia
     * @version 1.0
     */
    @Override
    public List<SysDepartment> selectSysDepartmentParent(Long sysDepartmentParentId){
        return sysDepartmentManager.selectSysDepartmentParent(sysDepartmentParentId);
    }

    /**
     * 添加部门信息
     *
     * @param sysDepartment 部门对象
     * @return boolean
     * @date 2021/5/10 9:23
     * @author ChenYongJia
     * @version 1.0
     */
    @Override
    public boolean addDepartmentInfo(SysDepartment sysDepartment) {
        return sysDepartmentManager.addDepartmentInfo(sysDepartment);
    }

    /**
     * 修改部门信息
     *
     * @param sysDepartment 部门对象
     * @return boolean
     * @date 2021/5/10 9:23
     * @author ChenYongJia
     * @version 1.0
     */
    @Override
    public boolean updateDepartmentInfo(SysDepartment sysDepartment) {
        return sysDepartmentManager.updateDepartmentInfo(sysDepartment);
    }

    /**
     * 删除部门信息（逻辑删除）
     *
     * @param sysDepartment 部门对象
     * @return boolean
     * @date 2021/5/10 9:23
     * @author ChenYongJia
     * @version 1.0
     */
    @Override
    public boolean deleteDepartmentInfo(SysDepartment sysDepartment) {
        return sysDepartmentManager.deleteDepartmentInfo(sysDepartment);
    }

    /**
     * 根据部门列表
     *
     * @return java.util.List<com.dream.DreamChardonnay.model.system.SysDepartment>
     * @date 2021/6/10 15:36
     * @author ChenYongJia
     * @version 1.0
     */
    @Override
    public List<SysDepartment> selectSysDepartmentList() {
        return sysDepartmentManager.selectSysDepartmentList();
    }

}
